package com.sping.gobang.common.util;

import com.sping.gobang.pojo.datapbject.User;
import com.sping.gobang.pojo.request.UserLoginRequest;
import com.sping.gobang.pojo.request.UserRegisterRequest;
import org.springframework.beans.BeanUtils;

public class BeanTransUtils {
    public static User trans(UserLoginRequest userLoginRequest){
        if(userLoginRequest==null){
            return null;
        }
        User user=new User();
        BeanUtils.copyProperties(userLoginRequest,user);
        return user;
    }
    public static User trans(UserRegisterRequest userRegisterRequest){
        if(userRegisterRequest==null){
            return null;
        }
        User user=new User();
        BeanUtils.copyProperties(userRegisterRequest,user);
        return user;
    }
}
